<template>
  <quick-layout
    ref="Instance"
    :is-operate-btn="true"
    :is-operate="true"
    :data-list-url="dataListUrl"
    :delete-url="deleteUrl"
    :export-url="exportUrl"
    :import-url="importUrl"
    table-title="环境监测阈值配置"
    :is-row-model="true"
    label-width="150px"
    size="small"
    @edit="handleEdit"
    @created="handleEdit(null)"
  >
    <template v-slot:query="{query,reset}">
      <query-item label="ID" prop="id">
        <el-input v-model="query.id" placeholder="ID" />
      </query-item>
      <query-item label="业务主键" prop="businessKey">
        <el-input v-model="query.businessKey" placeholder="业务主键" />
      </query-item>
      <query-item label="附件ID" prop="attachId">
        <el-input v-model="query.attachId" placeholder="附件ID" />
      </query-item>
      <query-item label="数据来源" prop="dataSource">
        <el-input v-model="query.dataSource" placeholder="数据来源" />
      </query-item>
      <query-item label="监测采集点" prop="deviceLocation">
        <el-input v-model="query.deviceLocation" placeholder="监测采集点" />
      </query-item>
      <query-item label="红灯下限计算条件" prop="redLightCondition">
        <el-input v-model="query.redLightCondition" placeholder="红灯下限计算条件" />
      </query-item>
      <query-item label="红灯下限" prop="redLightLimit">
        <el-input v-model="query.redLightLimit" placeholder="红灯下限" />
      </query-item>
      <query-item label="黄灯下限计算条件" prop="yellowLightCondition">
        <el-input v-model="query.yellowLightCondition" placeholder="黄灯下限计算条件" />
      </query-item>
      <query-item label="黄灯下限" prop="yellowLightLimit">
        <el-input v-model="query.yellowLightLimit" placeholder="黄灯下限" />
      </query-item>
      <query-item label="绿灯下限计算条件" prop="greenLightCondition">
        <el-input v-model="query.greenLightCondition" placeholder="绿灯下限计算条件" />
      </query-item>
      <query-item label="绿灯下限" prop="greenLightLimit">
        <el-input v-model="query.greenLightLimit" placeholder="绿灯下限" />
      </query-item>
      <query-item label="是否开启报警" prop="alarmStatus">
        <el-input v-model="query.alarmStatus" placeholder="是否开启报警" />
      </query-item>
      <query-item label="是否开启预警" prop="earlyWarnStatus">
        <el-input v-model="query.earlyWarnStatus" placeholder="是否开启预警" />
      </query-item>
      <query-item label="连续上升N次后预警" prop="riseLimit">
        <el-input v-model="query.riseLimit" placeholder="连续上升N次后预警" />
      </query-item>
      <query-item label="单位" prop="unit">
        <el-input v-model="query.unit" placeholder="单位" />
      </query-item>
      <query-item label="备注" prop="remark">
        <el-input v-model="query.remark" placeholder="备注" />
      </query-item>
      <query-item label="创建人工号" prop="createdUserCode">
        <el-input v-model="query.createdUserCode" placeholder="创建人工号" />
      </query-item>
      <query-item label="创建人姓名" prop="createdUserName">
        <el-input v-model="query.createdUserName" placeholder="创建人姓名" />
      </query-item>
      <query-item label="创建时间" prop="createdTime">
        <el-input v-model="query.createdTime" placeholder="创建时间" />
      </query-item>
      <query-item label="修改人工号" prop="updatedUserCode">
        <el-input v-model="query.updatedUserCode" placeholder="修改人工号" />
      </query-item>
      <query-item label="修改人姓名" prop="updatedUserName">
        <el-input v-model="query.updatedUserName" placeholder="修改人姓名" />
      </query-item>
      <query-item label="修改时间" prop="updatedTime">
        <el-input v-model="query.updatedTime" placeholder="修改时间" />
      </query-item>
      <query-item label="删除标志" prop="delFlag">
        <el-input v-model="query.delFlag" placeholder="删除标志" />
      </query-item>
    </template>
    <template>
      <el-table-column type="selection" header-align="center" align="center" width="50" />
      <el-table-column prop="id" label="ID" header-align="center" align="center" />
      <el-table-column prop="businessKey" label="业务主键" header-align="center" align="center" />
      <el-table-column prop="attachId" label="附件ID" header-align="center" align="center" />
      <el-table-column prop="dataSource" label="数据来源" header-align="center" align="center" />
      <el-table-column prop="deviceLocation" label="监测采集点" header-align="center" align="center" />
      <el-table-column prop="redLightCondition" label="红灯下限计算条件" header-align="center" align="center" />
      <el-table-column prop="redLightLimit" label="红灯下限" header-align="center" align="center" />
      <el-table-column prop="yellowLightCondition" label="黄灯下限计算条件" header-align="center" align="center" />
      <el-table-column prop="yellowLightLimit" label="黄灯下限" header-align="center" align="center" />
      <el-table-column prop="greenLightCondition" label="绿灯下限计算条件" header-align="center" align="center" />
      <el-table-column prop="greenLightLimit" label="绿灯下限" header-align="center" align="center" />
      <el-table-column prop="alarmStatus" label="是否开启报警" header-align="center" align="center" />
      <el-table-column prop="earlyWarnStatus" label="是否开启预警" header-align="center" align="center" />
      <el-table-column prop="riseLimit" label="连续上升N次后预警" header-align="center" align="center" />
      <el-table-column prop="unit" label="单位" header-align="center" align="center" />
      <el-table-column prop="remark" label="备注" header-align="center" align="center" />
      <el-table-column prop="createdUserCode" label="创建人工号" header-align="center" align="center" />
      <el-table-column prop="createdUserName" label="创建人姓名" header-align="center" align="center" />
      <el-table-column prop="createdTime" label="创建时间" header-align="center" align="center" />
      <el-table-column prop="updatedUserCode" label="修改人工号" header-align="center" align="center" />
      <el-table-column prop="updatedUserName" label="修改人姓名" header-align="center" align="center" />
      <el-table-column prop="updatedTime" label="修改时间" header-align="center" align="center" />
      <el-table-column prop="delFlag" label="删除标志" header-align="center" align="center" />
    </template>
    <template #component>
      <add-or-update ref="addOrUpdateRef" @refreshDataList="getDataList" />
    </template>
  </quick-layout>
</template>

<script>
import AddOrUpdate from './add-or-update.vue'
import QuickLayout from '@/components/EmpsLayout/index.vue'
import QueryItem from '@/components/QueryItem/index.vue'

export default {
  name: 'EnvironmentalMonitoringConfiguration',
  components: { QuickLayout, QueryItem, AddOrUpdate },
  data() {
    return {
      dataListUrl: '/business/environmental_monitoring_configuration/page',
      deleteUrl: '/business/environmental_monitoring_configuration',
      exportUrl: '/business/environmental_monitoring_configuration/export',
      importUrl: '/business/environmental_monitoring_configuration/import',
      businessEnum: []
    }
  },
  created() {
    this.getBusinessEnum()
  },
  methods: {
    getInstance() {
      return this.$ref.Instance
    },
    handleEdit(id) {
      this.$refs.addOrUpdateRef.init(id)
    },
    getDataList() {
      this.getInstance().query()
    }
  }
}
</script>
